﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.Linq;
using System.Linq;

namespace ProyectoEscuela
{
    public partial class frmCertificado7mo : ProyectoEscuela.frmBaseForm
    {
        dbProyectoEscuelaDataContext dbPE = Global.getInstance().db;

        public frmCertificado7mo()
        {
            InitializeComponent();
        }

        private void frmCertificado7mo_Load(object sender, EventArgs e)
        {
            dgvAlumnos.DataSource = from alu in dbPE.Personas where alu is Alumno select alu;

        }

        private void cbxTipoDoc_SelectionChangeCommitted(object sender, EventArgs e)
        {

            //dgvAlumnos.DataSource = from alu in dbPE.Personas where alu && alu.TipoDoc == cbxTipoDoc.Text is Alumno select alu ;
            dgvAlumnos.DataSource = from alu in dbPE.Personas where alu.TipoDoc == cbxTipoDoc.Text.ToString() && alu is Alumno select alu;

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //
            //dgvAlumnos.DataSource = from alu in dbPE.Personas where alu is Alumno && alu.Numdoc == txbDocumento.Text.ToString() select alu;
            //var alumno=
            dgvAlumnos.DataSource = from alu in dbPE.Personas where alu.Numdoc == "29012968" && alu is Alumno select alu;

        }

        private void button3_Click(object sender, EventArgs e)
        {
            dgvAlumnos.DataSource = null;
            dgvAlumnos.Refresh();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
        }
    }
}
